package io.renren.modules.user.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.user.dao.PgibmperDao;
import io.renren.modules.user.entity.PgibmperEntity;
import io.renren.modules.user.service.PgibmperService;


@Service("pgibmperService")
public class PgibmperServiceImpl extends ServiceImpl<PgibmperDao, PgibmperEntity> implements PgibmperService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String username = (String)params.get("key");
        IPage<PgibmperEntity> page = this.page(
                new Query<PgibmperEntity>().getPage(params),
                new QueryWrapper<PgibmperEntity>()
                        .like(StringUtils.isNotBlank(username),"user_name", username)
        );

        return new PageUtils(page);
    }

}